<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE HTML>
<html lang="zh-CN">
    <head>
    <!-- 定制项目 -->
    <title><spring:message code="custom_list_title"/></title>
    <meta name="decorator" content="default" />
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
        <script type="text/javascript">
            $(document).ready(function(){
                searchListForm();
                $("#styleCategoryCD").select2();

            });
            //检索
            function searchListForm() {
                var styleCategoryCD = $("#styleCategoryCD").val();
                $("#activity_pane").showLoading();
                $.post("${ctx}/custom/customitem/searchList?styleCategoryCD="+styleCategoryCD,"", function(result) {
                    var listHtml = result["designOption"];
                    var pageHtml = result["page"];
                    $("#listHtml").html(listHtml);
                    $("#paging").html(pageHtml);
                    $("#activity_pane").hideLoading();
                }, 'json');
            }
            // 检索条件重置
            function resets() {
            	// 表单重置
                $("#searchForm")[0].reset();  
            	// 下拉框清空
                $('#styleCategoryCD').val('');
            	// 下拉选框带搜索功能
                $("#styleCategoryCD").select2(); 
            	// 表单提交执行action方法
                $("#searchForm").submit();
                //检索
                searchListForm()
            }
            //导入/导出ecxcel
            function importExcel(){
                
                var url="${ctx}/common/importExcel?action=${ctx}/custom/customitem/import&template=${ctx}/custom/customitem/import/template";
                
                popup('400px','230px',url);
            }
        </script>
    </head>
    <body>
        <div class="listArea" id="activity_pane">
        	<!-- 初始化方法action -->
            <form id="searchForm" method="post">
                <div class="listBg">
                    <div class="searchArea clearfix">
                        <div class="searchLeft clearfix"style="width:800px">
                            <div class="searchInp clearfix">
                             <!-- 款式类别： -->
                                  <p class="searchTxt">
                                   <spring:message code="custom_style_category"/>
                                  </p>
                            <div class="searchInp">
                                <c:set value="<%=ResourcesUtil.getConfig(\"style_category\")%>" var="styleCategoryList" />
                                <select style="width:130px" id="styleCategoryCD" name="styleCategoryCD" data-rule-required="true" data-msg-required="<spring:message code="custom_style_alert"/>">
                                <!--请输入款式-->
                                <option value=''><spring:message code="custom_style_alert"/></option>
                                <c:forEach items="${fns:getDictList(styleCategoryList)}" var="styleCategory">
                                    <option value="${styleCategory.itemCode}-${styleCategory.itemValue}" <c:if test="${fn:split(designOption.styleCategoryCD,'-')[1] ==styleCategory.itemValue }">selected="selected"</c:if>>${styleCategory.itemName}</option>
                                </c:forEach>
                                </select>
                             </div>
                         </div>
                         </div>
                        <div class="searchRight clearfix" id="subItem">
                            <shiro:hasPermission name="custom:customitem:edit">
                            <!-- 导入/导出 -->
                             <button type="button"  onclick="importExcel()"><spring:message code="common_im_export"/></button>
                            <!-- 创建 -->
                            <button type="button"  onclick="popup('935px','550px','${ctx}/custom/customitem/form')"><spring:message code="common_create"/></button>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="custom:customitem:view">
                            <!-- 重置 -->
                            <button type="button"  onclick="resets();" >
                              <spring:message code="common_reset"/>
                            </button>
                            <!-- 检索 -->
                             <button type="button" onclick="searchListForm();">
                             <spring:message code="commom_check" />
                             </button>
                             </shiro:hasPermission>
                        </div>
                     </div>
                    <div class="tableArea">
                          <div class="tableScrollSm"  style="overflow: auto;width: 1308px;height: 714px; ">
                            <table cellpadding="0" class="tableHead" >
                                  <thead>
                                        <tr>
                                <!-- No. -->
                                <th><p class="table-No">
                                    <spring:message code="common_no" />
                                </p></th>
                                <!-- 项目CODE -->
                                <th><p class="table-cus-xmCD">
                                    <spring:message code="custom_project_cd" />
                                </p></th>
                                <!-- 中文全称 -->
                                <th><p class="table-cus-zwmc">
                                    <spring:message code="custom_item_cn" />
                                </p></th>
                                <!-- 英文全称 -->
                                <th><p class="table-cus-ywmc">
                                    <spring:message code="custom_item_en" />
                                </p></th>
                                <!-- 日文全称 -->
                                <th><p class="table-cus-rwmc">
                                    <spring:message code="custom_item_jp" />
                                </p></th>
                                <!-- 备注 -->
                                <th><p class="table-cus-bz">
                                    <spring:message code="common_remarks" />
                                </p></th>
                                <!-- 状态 -->
                                <th><p class="table-cus-zt">
                                    <spring:message code="common_status" />
                                </p></th>
                                <!-- 最后更新者 -->
                                <th><p class="table-cus-zhgxz">
                                    <spring:message code="custom_last_update_user" />
                                </p></th>
                                <!-- 更新日期 -->
                                <th><p class="table-cus-zhgxrq">
                                    <spring:message code="common_update_date" />
                                </p></th>
                            </tr>
                                  </thead>
                            </table>
                            <table cellpadding="0" class="tableBody" >
                            <tbody  id = "listHtml"></tbody>
                            </table>
                          </div>
                    </div>
                </div>
                <div id = "paging" ></div>
             </form>
        </div>
    </body>
</html>
